1. Field of the Invention
The present invention relates to a length calculation and determination device, an angle calculation and determination device and an image determination system that quickly calculate and determine the length and the angle between inputted coordinate data, and determines whether an inputted image concurs with a predetermined image.
2. Description of the Related Art
There are many occasions where a computer calculates a distance (length) between two points, and determines whether the distance is longer or shorter. For example, in game software used in a home gaming apparatus, a distance between two characters is calculated to determine whether the distance is long or short, the distance between a ball and a goal is calculated to determine the positional relation between the two, and the like. Similarly, there are many instances where angles are calculated.
Japanese laid-open patent application HEI 10-123797 filed by the present applicant relates to a technique for preventing a copy machine from copying a bank note and proposes “Image Rough Determination Apparatus, . . . Color Copy Machine” that is capable of determining in a shorter period of time whether an image read by a copy machine is part of a bank note. In the invention described therein, a determination is made whether or not characteristic portions of a bank note are included in an image read by a scanner, and a comparison is made for their positional relations (distances and angles) when the characteristic portions of a bank note are included. A determination is made that the bill is included in the image read by the scanner when the positional relations are in predefined orientations with one another.
More specifically, as shown in FIG. 5, (1) a specified process is performed on images in three characteristic portions (approximately 2 centimeter squares, that are hereunder referred to as “blocks”) of a bank note to create data (hereunder referred to as “bill data”), and the data is stored in a database. At the same time, data for relative positional relations D1, D2 and θ between the three blocks (BLK1, BLK2 and BLK3) are created and stored in a database. It is noted that D1 is the distance (length) of a line segment defined between the block BLK1 and the block BLK2, D2 is the distance (length) of a line segment defined between the block BLK1 and the block BLK3, and θ is an included angle defined between the line segment D1 and the line segment D2.
(2) Then, a specified process is performed on an image that is read by a scanner in order to make a copy thereof, and a determination is made whether or not the image has blocks that concur with the blocks BLK1, BLK2 and BLK3 stored in the data base. This step is hereunder referred to as “pattern matching”. In this instance, each time a determination is made that the pattern of a block concurs with any one of the blocks, positional data for the location thereof is stored.
(3) When the pattern matching is completed, a determination is made as to whether a combination of the blocks BLK1, BLK2 and BLK3 exists in all of the blocks detected. When such combinations exist, relative positional relations D1, D2 and θ for all of such combinations are calculated based on the stored positional data.
(4) Lastly, the relative positional relations D1, D2 and θ are compared with one another. When the relative positional relations stored in the database concur with those detected and calculated from the image read by the scanner, a determination is made that the image read by the scanner is part of the bank note. This step is hereunder referred to as “structure matching”. It is determined that the blocks BLK1, BLK2 and BLK3 compose a triangle, and the relative positional relations D1, D2 and θ represent congruent conditions of a triangle.
In this manner, it is also very important to calculate the distance (length) and angle in the prevention of copying bank notes.
It is noted that the calculation of the distance and angle in game software needs to be quickly performed in order to make the game more enjoyable. In a similar manner, the calculation of the distance and angle in the copy machine described above, as well as the determination of bank notes, need to be quickly performed in view of the necessity of recognizing an image of a bank note among a variety of different images.
However, when coordinates O (0, 0) and P (x, y) of two points on a plane are given, and the distance OP of a line segment is calculated by OP=(x2+y2)1/2, a square root needs to be calculated. As a result, an operational load to the computer hardware is heavy and the calculation takes a long time. Similarly, when coordinates O (0, 0), P1 (x1, y1) and P2 (x2, y2) of three points on a plane are given, these three points are assumed to define a triangle, and an included angle θ defined between an edge OP1 and an edge OP2 is calculated by θ=cos−1 {(x1x2+y1y2)/[(x12+y12)1/2(x22+y22)1/2]}, an inverse trigonometric function and a division need to be calculated in addition to a square root. This results in a longer calculation time. A high power CPU may be used to shorten the calculation time. However, this leads to a higher cost and therefore is not preferable. Also, in the copy machine described above, the timing at which a determination is to be made as to whether or not an object image and a reference image concur with each other is important, in addition to shortening the calculation time. Depending on the timing, inconvenient situations occur. For example, a waiting period may continue for a long time, or the presence of a bank note may be recognized after portions in which the bank note is present are copied (outputted).